blob: aaa88526291a26db55c7ebb0833faefda9c7e5a4 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-repack(1)
2=============
3
4NAME
5----
Junio C Hamano7c73c662007-01-19 00:37:506git-repack - Pack unpacked objects in a repository
Junio C Hamano1a4e8412005-12-27 08:17:237
8
9SYNOPSIS
10--------
Junio C Hamanofce7c7e2008-07-02 03:06:3811'git repack' [-a] [-A] [-d] [-f] [-l] [-n] [-q] [--window=N] [--depth=N]
Junio C Hamano1a4e8412005-12-27 08:17:2312
13DESCRIPTION
14-----------
15
16This script is used to combine all objects that do not currently
Junio C Hamanoa6387422007-08-25 03:54:2717reside in a "pack", into a pack. It can also be used to re-organize
Junio C Hamano401939f2007-07-01 06:34:3018existing packs into a single, more efficient pack.
Junio C Hamano1a4e8412005-12-27 08:17:2319
20A pack is a collection of objects, individually compressed, with
21delta compression applied, stored in a single file, with an
22associated index file.
23
24Packs are used to reduce the load on mirror systems, backup
25engines, disk storage, etc.
26
27OPTIONS
28-------
29
30-a::
31Instead of incrementally packing the unpacked objects,
Junio C Hamano401939f2007-07-01 06:34:3032pack everything referenced into a single pack.
Junio C Hamano1a4e8412005-12-27 08:17:2333Especially useful when packing a repository that is used
Junio C Hamano9cb74f22007-02-12 04:15:0534for private development and there is no need to worry
Junio C Hamano401939f2007-07-01 06:34:3035about people fetching via dumb protocols from it. Use
36with '-d'. This will clean up the objects that `git prune`
37leaves behind, but `git fsck --full` shows as
38dangling.
Junio C Hamano1a4e8412005-12-27 08:17:2339
Junio C Hamanob713ff12008-05-24 01:12:3040-A::
Junio C Hamanobba37ad2008-11-16 17:47:5941Same as `-a`, unless '-d' is used. Then any unreachable
42objects in a previous pack become loose, unpacked objects,
43instead of being left in the old pack. Unreachable objects
44are never intentionally added to a pack, even when repacking.
45This option prevents unreachable objects from being immediately
Junio C Hamanob713ff12008-05-24 01:12:3046deleted by way of being left in the old pack and then
47removed. Instead, the loose unreachable objects
48will be pruned according to normal expiry rules
Junio C Hamanoba4b9282008-07-06 05:20:3149with the next 'git-gc' invocation. See linkgit:git-gc[1].
Junio C Hamanob713ff12008-05-24 01:12:3050
Junio C Hamano1a4e8412005-12-27 08:17:2351-d::
52After packing, if the newly created packs make some
53existing packs redundant, remove the redundant packs.
Junio C Hamanoba4b9282008-07-06 05:20:3154Also run 'git-prune-packed' to remove redundant
Junio C Hamanofce7c7e2008-07-02 03:06:3855loose object files.
Junio C Hamano1a4e8412005-12-27 08:17:2356
57-l::
Junio C Hamanoba4b9282008-07-06 05:20:3158Pass the `--local` option to 'git-pack-objects'. See
Junio C Hamano35738e82008-01-07 07:55:4659linkgit:git-pack-objects[1].
Junio C Hamano1a4e8412005-12-27 08:17:2360
Junio C Hamano7e9f6b72006-02-22 10:44:5561-f::
Junio C Hamano7cc91292008-09-20 16:55:3862Pass the `--no-reuse-object` option to `git-pack-objects`, see
Junio C Hamano35738e82008-01-07 07:55:4663linkgit:git-pack-objects[1].
Junio C Hamano7e9f6b72006-02-22 10:44:5564
65-q::
Junio C Hamanoba4b9282008-07-06 05:20:3166Pass the `-q` option to 'git-pack-objects'. See
Junio C Hamano35738e82008-01-07 07:55:4667linkgit:git-pack-objects[1].
Junio C Hamano7e9f6b72006-02-22 10:44:5568
Junio C Hamano1a4e8412005-12-27 08:17:2369-n::
Junio C Hamanob713ff12008-05-24 01:12:3070Do not update the server information with
Junio C Hamanoba4b9282008-07-06 05:20:3171'git-update-server-info'. This option skips
Junio C Hamanob713ff12008-05-24 01:12:3072updating local catalog files needed to publish
73this repository (or a direct copy of it)
Junio C Hamanoba4b9282008-07-06 05:20:3174over HTTP or FTP. See linkgit:git-update-server-info[1].
Junio C Hamano1a4e8412005-12-27 08:17:2375
Junio C Hamanoeb415992008-06-08 22:49:4776--window=[N]::
77--depth=[N]::
Junio C Hamano93567a62006-10-08 08:47:5678These two options affect how the objects contained in the pack are
Junio C Hamano3eb513f2006-09-18 02:47:1679stored using delta compression. The objects are first internally
80sorted by type, size and optionally names and compared against the
81other objects within `--window` to see if using delta compression saves
82space. `--depth` limits the maximum delta depth; making it too deep
83affects the performance on the unpacker side, because delta data needs
84to be applied that many times to get to the necessary object.
Junio C Hamano91d44c52007-05-09 07:16:0785The default value for --window is 10 and --depth is 50.
Junio C Hamano3eb513f2006-09-18 02:47:1686
Junio C Hamano235d53f2007-07-13 00:25:1587--window-memory=[N]::
88This option provides an additional limit on top of `--window`;
89the window size will dynamically scale down so as to not take
90up more than N bytes in memory. This is useful in
91repositories with a mix of large and small objects to not run
92out of memory with a large window, but still be able to take
93advantage of the large window for the smaller objects. The
94size can be suffixed with "k", "m", or "g".
95`--window-memory=0` makes memory usage unlimited, which is the
96default.
97
Junio C Hamano591dc6a2007-05-29 09:18:1998--max-pack-size=<n>::
99Maximum size of each output packfile, expressed in MiB.
100If specified, multiple packfiles may be created.
101The default is unlimited.
102
Junio C Hamano3eb513f2006-09-18 02:47:16103
Junio C Hamano77b7e902006-10-23 07:18:50104Configuration
105-------------
106
107When configuration variable `repack.UseDeltaBaseOffset` is set
108for the repository, the command passes `--delta-base-offset`
Junio C Hamanoba4b9282008-07-06 05:20:31109option to 'git-pack-objects'; this typically results in slightly
Junio C Hamano77b7e902006-10-23 07:18:50110smaller packs, but the generated packs are incompatible with
111versions of git older than (and including) v1.4.3; do not set
112the variable in a repository that older version of git needs to
113be able to read (this includes repositories from which packs can
114be copied out over http or rsync, and people who obtained packs
115that way can try to use older git with it).
116
117
Junio C Hamano1a4e8412005-12-27 08:17:23118Author
119------
120Written by Linus Torvalds <torvalds@osdl.org>
121
122Documentation
123--------------
124Documentation by Ryan Anderson <ryan@michonline.com>
125
Junio C Hamano9049d912008-05-29 02:09:50126SEE ALSO
Junio C Hamano1a4e8412005-12-27 08:17:23127--------
Junio C Hamano35738e82008-01-07 07:55:46128linkgit:git-pack-objects[1]
129linkgit:git-prune-packed[1]
Junio C Hamano1a4e8412005-12-27 08:17:23130
131GIT
132---
Junio C Hamanof7c042d2008-06-06 22:50:53133Part of the linkgit:git[1] suite